package com.cndw.kungfu.vo.siege;

import java.io.Serializable;

/**
 * 个人积分记录
 * 
 * @author <a href="mailto:whz-work@163.com">汪洪州</a>
 * 
 * @since 1.0 Create on 2012-2-23
 */
public class PlayerRankingVO implements Serializable, Comparable<PlayerRankingVO> {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 7102709437523154738L;
	private long id;
	private int ranking;
	private String name;
	private int score;

	public PlayerRankingVO(long id, int ranking, String name, int score) {
		this.id = id;
		this.ranking = ranking;
		this.name = name;
		this.score = score;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public int getRanking() {
		return ranking;
	}

	public void setRanking(int ranking) {
		this.ranking = ranking;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public void alterScore(int score) {
		this.score += score;
	}

	@Override
	public int compareTo(PlayerRankingVO o) {
		if (o.getScore() > getScore()) {
			return 1;
		} else {
			return -1;
		}
	}
}
